<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            border-left: solid 2px #ccc;
            border-top: solid 2px #ccc;
            width: 500px;
            margin: auto;
            border-collapse: collapse;
        }

        td {
            border-right: solid 2px #ccc;
            border-bottom: solid 2px #ccc;
            height: 40px;
        }
    </style>
</head>
<body>
    <!-- <table>
        <tr>
            <td></td>
        </tr>
    </table> -->
    <script>
        var table = document.createElement('table');
        document.body.appendChild(table);

        for(var j = 0;j < 3;j++){
            var tr = document.createElement('tr');
            table.appendChild(tr);
            for(var i = 0;i < 4;i++){
                var td = document.createElement('td');
                tr.appendChild(td);
            }
        }
    </script>
</body>
</html>